package cn.te.helloo;


public class W3 {
    public static void main(String[] args) {
        for (int i = 0; i <4; i++) {
            new Mytickets().start();
        }

    }
}

class Mytickets extends Thread {
    static  int tickets = 100;
    @Override
      public void run() {
        while (true) {
            if (tickets > 0) {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(super.getName()+"---"+tickets--);

            } else {
                break;
            }
        }
    }
}
